﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HPPropertyFactory : PropertyFactoryBase
{
    private GameObject hero;

    public override GameProperty GamePropertyCreator()
    {
        var hp = new GameProperty(100,0,800);
        hp.AfterValueChange.AddListener((float value)=>
        {
            Debug.Log("Value is "+value);
            if(value == 0)
                Object.Destroy(hero);
        });

        return hp;
    }

    public HPPropertyFactory(GameObject hero)
    {
        this.hero = hero;
    }
}
